package com.zk.qqrobot.controller;

import com.zk.qqrobot.service.SSRService;
import com.zk.qqrobot.util.SSRValidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/ssr")
public class SSRController {
    @Autowired
    private SSRService ssrService;

    @PostMapping("/validSsr")
    public Object validSsr(String ssr){
        return SSRValidUtil.valid(ssr);
    }

    @GetMapping("/findSsrCatch")
    public String findSsrCatch(String urlCode){
        return ssrService.findSsrCatch(urlCode);
    }

    @PostMapping("/ssrCatch")
    public String ssrCatch(@RequestParam String urlCode,@RequestParam String ssr){
        System.out.println("======ur=" + urlCode );
        return ssrService.ssrCatch(urlCode,ssr);
    }
}
